Current Location: Home> Function Categories> min

min

Find the minimum value
Name:min
Category:math
Programming Language:php
One-line Description:Returns the minimum value.

Definition and usage

min() returns the minimum value.

Example

In this example, we will use min() to return the minimum value of the two specified numbers:

 <?php
echo ( min ( 5 , 7 ) ) ;
echo ( min ( - 3 , 5 ) ) ;
echo ( min ( - 3 , - 5 ) ) ;
echo ( min ( 7.25 , 7.30 ) ) ;
?>

Try it yourself

grammar

 min ( x , y )
parameter describe
x Required. A number.
y Required. A number.

illustrate

min() returns the smallest value in the parameter.

If there is only one parameter and is an array, min() returns the smallest value in the array. If the first parameter is an integer, string, or floating point number, at least two parameters are required and min() returns the smallest of these values. An infinite number of values ​​can be compared.

Similar Functions
  • Cosine cos

    cos

    Cosine
  • Convert angle to radians deg2rad

    deg2rad

    Convertangletoradian
  • Convert octal to decimal octdec

    octdec

    Convertoctaltodecima
  • Generate a random integer rand

    rand

    Generatearandominteg
  • Generate better random numbers mt_rand

    mt_rand

    Generatebetterrandom
  • Perform floating point division under IEEE 754 semantics fdiv

    fdiv

    Performfloatingpoint
  • Find the minimum value min

    min

    Findtheminimumvalue
  • Hyperbolic sine sinh

    sinh

    Hyperbolicsine
Popular Articles